<?php

namespace app\backend\validate;

use app\common\RootValidate;

class ConvertValidate extends RootValidate
{
    protected $rule = [
        'id' => 'require',
        'state' => 'require',
        'type' => 'require',
        'currency' => 'require',
        'audit' => 'require',
        'name' => 'require',
        'quantity' => 'require|number|gt:0',
        'frequency' => 'require|between:0,255',
        'invite' => 'between:0,255',
        'remark' => 'length:3,255'
    ];

    protected $message = [
        'id.require' => '无效的套餐',
        'name.require' => '请输入套餐名称',
        'quantity.require' => '请输入金币数量',
        'quantity.number' => '兑换数量无效',
        'quantity.gt' => '金币数量必须大于0',
        'audit.require' => '请选择打款方式',
        'frequency.require' => '请输入提现次数',
        'frequency.between' => '提现次数应在0-255之间',
        'state.require' => '请选择套餐状态',
        'type.require' => '请选择支付通道',
        'currency.require' => '请选择收款方式',
        'sort.between' => '连签天数应在0-255之间',
        'remark.length' => '备注内容应在3~255个字符之间',
    ];

    protected $scene = [
        'add' => ['state', 'type', 'currency', 'audit', 'name', 'quantity', 'frequency', 'sort', 'remark'],
        'edit' => ['id', 'state', 'type', 'currency', 'audit', 'name', 'quantity', 'frequency', 'sort', 'remark'],
    ];
}